
pkgname=kbd
pkgver=2.0.4
pkgrel=1
pkgdesc="Keytable files and keyboard utilities"
arch=('x86_64')
url="http://www.kbd-project.org"
license=('GPL')
depends=('glibc' 'pam')
makedepends=('check')
source=("ftp://ftp.kernel.org/pub/linux/utils/kbd/${pkgname}-${pkgver}.tar.gz")
md5sums=('c69fce737a5fd0fa686cbfc4f611a220')

build() {
  cd ${pkgname}-${pkgver}

  # Rename conflicting keymaps to have unique names
  mv data/keymaps/i386/qwertz/cz{,-qwertz}.map
  mv data/keymaps/i386/olpc/es{,-olpc}.map
  mv data/keymaps/i386/olpc/pt{,-olpc}.map
  mv data/keymaps/i386/dvorak/no{,-dvorak}.map
  mv data/keymaps/i386/fgGIod/trf{,-fgGIod}.map
  mv data/keymaps/i386/colemak/{en-latin9,colemak}.map

  ./configure --prefix=/usr \
    --datadir=/usr/share/kbd \
    --mandir=/usr/share/man
    
  make KEYCODES_PROGS=yes RESIZECONS_PROGS=yes
}

package() {
  cd ${pkgname}-${pkgver}
  
  make KEYCODES_PROGS=yes RESIZECONS_PROGS=yes DESTDIR=${pkgdir} install
}
